﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ImageUploader.GUI;
using System.Windows.Forms;
using ImageUploader.domain;

namespace ImageUploader
{
    public class GUIController
    {
       /* private static GUIController instance;

        private LoginForm loginForm;

        private GUIController()
        { }

        public static GUIController Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new GUIController();
                }
                return instance;
            }
        }
        */

        public static void ShowLoginForm()
        {
            LoginForm loginForm=new LoginForm();
            if (loginForm.ShowDialog()==DialogResult.OK)
                ShowChooseOptionsForm(loginForm.LDAPConnection);
            else
                Application.Exit();                
        }

        public static void ShowChooseOptionsForm(LDAPConnection ldapConnection)
        {
            new ChooseOptionsForm(ldapConnection).Show();
        }

        public static ImageUploader.domain.OverwriteAnswer ShowOverwriteUserDialog(string cn)
        {
            //DialogResult dr = new OverwriteUserDialog(cn).ShowDialog();  
            OverwriteUserDialog oud=new OverwriteUserDialog(cn);
            oud.ShowDialog();
            Application.DoEvents();
            return oud.OverwriteAnswer;
        }

    }
}
